package cn.youfule.dp.proxy;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class TimeHandler extends InvocationHandler {
	

	public TimeHandler(Object target) {
		super(target);
	}

	@Override
	public void invoke(Object o,Method m) {
		long start = System.currentTimeMillis();
		try {
			m.invoke(target);
		} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
			e.printStackTrace();
		}
		long end = System.currentTimeMillis();
		System.out.println("time:" + (end - start));
	}

}
